home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20010921-20020314 / 000214_fdc@columbia.edu_Fri Dec 7 09:52:39 EST 2001.msg < prev    next >
Text File  |  2020-01-01  |  3KB  |  93 lines

  1. Article: 13039 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!news.columbia.edu!news-not-for-mail
  3. From: fdc@columbia.edu (Frank da Cruz)
  4. Newsgroups: comp.os.linux.misc,comp.protocols.kermit.misc
  5. Subject: Re: Can't open("/dev/tty",O_RDWR) in RH7.1/ia64
  6. Date: 7 Dec 2001 09:52:23 -0500
  7. Organization: Columbia University
  8. Lines: 76
  9. Message-ID: <9uql37$m2c$1@watsol.cc.columbia.edu>
  10. References: <9uofq3$otq$1@watsol.cc.columbia.edu> <3C101149.5050103@redhat.com>
  11. NNTP-Posting-Host: watsol.cc.columbia.edu
  12. X-Trace: newsmaster.cc.columbia.edu 1007736745 18990 128.59.39.139 (7 Dec 2001 14:52:25 GMT)
  13. X-Complaints-To: postmaster@columbia.edu
  14. NNTP-Posting-Date: 7 Dec 2001 14:52:25 GMT
  15. Xref: newsmaster.cc.columbia.edu comp.os.linux.misc:529781 comp.protocols.kermit.misc:13039
  16.  
  17. In article <3C101149.5050103@redhat.com>,
  18. Michael Lee Yohe  <myohe+USENET@redhat.com> wrote:
  19. : > open() returns -1 with errno = 6 ("No such device or address")
  20. : > on the following platform:
  21. : Can you interact with /dev/tty?  For instance, can you type "cat 
  22. : /dev/tty", type things and see them echo'd back?
  23. When I first log in (over Telnet):
  24.  
  25.   Warning: no access to tty (Inappropriate ioctl for device).
  26.   Thus no job control in this shell.
  27.  
  28. Then:
  29.  
  30.   spe190> cat > /dev/tty
  31.   /dev/tty: No such device or address.
  32.   spe190>
  33.  
  34. Also, somebody else suggested that, despite the "man 2 open" statement:
  35.  
  36.   mode should always be specified when O_CREAT is in the
  37.   flags, and is ignored otherwise.
  38.  
  39. I should include the third argument:
  40.  
  41.   #include <stdio.h>
  42.   extern int errno;
  43.   main() {
  44.       int fd;
  45.       errno = 0;
  46.       fd = open("/dev/tty",2,0);
  47.       if (fd < 1) {
  48.       printf("fd = %d\n",fd);
  49.       printf("errno = %d\n",errno);
  50.       perror("/dev/tty");
  51.       exit(1);
  52.       } else {
  53.       printf("OK\n");
  54.       exit(0);
  55.       }
  56.   }
  57.  
  58. Result (same as before):
  59.  
  60.   fd = -1
  61.   errno = 6
  62.   /dev/tty: No such device or address
  63.  
  64. Again, the platform details:
  65.  
  66. uname -a:
  67.   Linux spe190 2.4.9-12smp #1 SMP Tue Oct 30 17:55:42 EST 2001 ia64 unknown
  68.  
  69. /etc/issue:
  70.   Red Hat Linux release 7.1 (Seawolf)
  71.   Kernel 2.4.9-12smp on a 4-processor ia64
  72.  
  73. ls -l /dev/tty:
  74.   crw-rw-rw-    1 root     root       5,   0 Dec  5 12:28 /dev/tty
  75.  
  76. Here's another peculiarity I noticed:
  77.  
  78.   cat > open.c
  79.   (paste...)
  80.   ^D
  81.   make open
  82.   make: *** Warning: File `open.c' has modification time in the future
  83.   (2001-12-07 09:39:23 > 2001-12-07 09:38:58)
  84.   cc open.c -o open
  85.   make: warning:  Clock skew detected.  Your build may be incomplete.
  86.  
  87. This is strange because I created the file with cat, so it got the system
  88. time, not some random time from a remote file system.
  89.  
  90. - Frank
  91.